<!DOCTYPE html>
<html>
<head lang="zh_cn">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
<input type="button" name="anniu2" onClick='copyUrl()' value="复制URL地址">
<script language="javascript">
    function copyUrl()
    {
        var clipBoardContent=this.location.href;
        alert(clipBoardContent);
        window.clipboardData.setData("Text",clipBoardContent);
        alert("复制成功!");
    }
</script>
</body>
</html>